using System;
using System.Configuration;

namespace Pharmacy.Ultilities.Configurations
{
    /// <summary>
    /// Get information from the App.config file.
    /// </summary>    
    public class ConfigManager
    {

        public static DIOConfig DIOConfig { get { return ConfigManager._DIOConfig; } }
        private static DIOConfig _DIOConfig = new DIOConfig();

        public static string path;
        public static DIOConfig DIOConfigServer { get { return new DIOConfig(path); } }        

        // private const 
        private ConfigManager()
        {
        }

        #region Import Engine

        #region propeties
        public static readonly string NO_DEFINED = "No Defined";

        public static readonly string APPLICATION_NAME = (ConfigurationManager.AppSettings["ApplicationName"] == null ? "Pharmacy" : ConfigurationManager.AppSettings["ApplicationName"].ToString());

        public static readonly string LOG_FOLDER = ConfigurationManager.AppSettings["LogFolder"];
        public static readonly string LOG_MODE = ConfigurationManager.AppSettings["LogMode"];

        public static readonly string LOG_PATH = ConfigurationManager.AppSettings["LogPath"];
        public static readonly string MAX_LOG_SIZE = ConfigurationManager.AppSettings["MaxLogSize"];
        #endregion

        #region Methods

        public static string GetConfigValue(string name)
        {
            return (ConfigurationManager.AppSettings[name] == null ? null : ConfigurationManager.AppSettings[name].ToString());
        }
        #endregion
        #endregion Import Engine
    }
}
